package com.cpems.system.config;

// RabbitMQ交换机配置类 - 已注释，如需使用RabbitMQ请取消注释
/*
import org.springframework.amqp.core.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * RabbitMQ交换机配置
 * 已注释 - 如需使用RabbitMQ功能请取消注释
 */
/*
//@Configuration
public class RabbitExChangeConfig {

    //1.定义交换机
    //@Bean("EquipmentTopicExchange")
    public Exchange EquipmentTopicExchange(){
        return ExchangeBuilder.topicExchange("EquipmentTopicExchange").durable(true).build();
    }

    //2.定义队列
    @Bean("ElectricUQueue")
    public Queue ElectricUQueue(){
        return QueueBuilder.durable("ElectricUQueue").build();
    }

    @Bean("ElectricIQueue")
    public Queue ElectricIQueue(){
        return QueueBuilder.durable("ElectricIQueue").build();
    }

    @Bean("ElectricWQueue")
    public Queue ElectricWQueue(){
        return QueueBuilder.durable("ElectricWQueue").build();
    }

    @Bean("ElectricPQueue")
    public Queue ElectricPQueue(){
        return QueueBuilder.durable("ElectricPQueue").build();
    }

    @Bean("WaterConsumptionQueue")
    public Queue WaterConsumptionQueue(){
        return QueueBuilder.durable("WaterConsumptionQueue").build();
    }

    //3.绑定队列和交换机
    @Bean
    public Binding bindingElectricU(){
        return BindingBuilder.bind(ElectricUQueue()).to(EquipmentTopicExchange()).with("electric.u").noargs();
    }

    @Bean
    public Binding bindingElectricI(){
        return BindingBuilder.bind(ElectricIQueue()).to(EquipmentTopicExchange()).with("electric.i").noargs();
    }

    @Bean
    public Binding bindingElectricW(){
        return BindingBuilder.bind(ElectricWQueue()).to(EquipmentTopicExchange()).with("electric.w").noargs();
    }

    @Bean
    public Binding bindingElectricP(){
        return BindingBuilder.bind(ElectricPQueue()).to(EquipmentTopicExchange()).with("electric.p").noargs();
    }

    @Bean
    public Binding bindingWaterConsumption(){
        return BindingBuilder.bind(WaterConsumptionQueue()).to(EquipmentTopicExchange()).with("water.consumption").noargs();
    }
}
*/
